let $db := doc("xp")
return 
	<user>
		<inscription_ranking>
			<note>{$db/ranking/rankings/inscriptionRanking//user[name/text() = "!user!"]/note/text()}</note>
			<rank>{$db/ranking/rankings/inscriptionRanking//user[name/text() = "!user!"]/rank/text()}</rank>
		</inscription_ranking>
		{for $xp in $db/ranking/rankings/notationRanking//xp
		return 
				<xp>
					{$xp/@id}
					<notations>
					{for $not in $xp//notation[user/name/text() = "!user!"]
					return 	
						<notation>
							{$not/@id}
							<points>{$not/user[name = "!user!"]/points/text()}</points>
							<rank>{$not/user[name = "!user!"]/rank/text()}</rank>
							<badges>
							{for $badge in $not/user[name = "!user!"]/badges//badge
							return 
								<badge>{$badge/nom/text()}</badge>
							}
							</badges>
						</notation>
					}
					</notations>
					<globalNotation>
						<points>{$db/ranking/rankings/globalRanking/xp[@id = $xp/@id]/user[name/text() = "!user!"]/points/text()}</points>
						<rank>{$db/ranking/rankings/globalRanking/xp[@id = $xp/@id]/user[name/text() = "!user!"]/rank/text()}</rank>
					</globalNotation>
				</xp>
			}
		</user>
	
			
					
	